An API is a collection of routines and/or protocols for building software applications that may be organized in libraries. An API allows software components to receive input, provide output, and facilitate operations. Further, an API may define functionalities. For example, a social media network may have an API that allows third party applications to query social media entries, receive results, and publish users' posts.
Hardware products may have their own API. For example, a hard drive may have its own API that defines available functions, such as writing and reading bits or addressing memory. Other products may have different APIs. Theses APIs may be updated to add additional functionality to existing products.